package com.sbpm.crmbpm.shared.data.organisation;


import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Entity
@Table( name = "USER" )
public class User implements Serializable
{
    @Id
    @Column( name = "USER_ID" )
    private String userId;

    @Column( name = "FIRST_NAME" )
    private String firstName;

    @Column( name = "MIDDLE_NAME" )
    private String middleName;

    @Column( name = "LAST_NAME" )
    private String lastName;

    @Enumerated( EnumType.STRING )
    @Column( name = "STATUS" )
    private UserStatus status;

    @Column( name = "IS_ACTIVE" )
    private boolean isActive;

    @OneToMany( fetch = FetchType.LAZY, mappedBy = "user" )
    private List<UserRoleRel> roles = new ArrayList<UserRoleRel>();

    public boolean isActive()
    {
        return isActive;
    }

    public void setActive( boolean isActive )
    {
        this.isActive = isActive;
    }

    public String getUserId()
    {
        return userId;
    }

    public void setUserId( String userId )
    {
        this.userId = userId;
    }

    public String getFirstName()
    {
        return firstName;
    }

    public void setFirstName( String firstName )
    {
        this.firstName = firstName;
    }

    public String getMiddleName()
    {
        return middleName;
    }

    public void setMiddleName( String middleName )
    {
        this.middleName = middleName;
    }

    public String getLastName()
    {
        return lastName;
    }

    public void setLastName( String lastName )
    {
        this.lastName = lastName;
    }

    public UserStatus getStatus()
    {
        return status;
    }

    public void setStatus( UserStatus status )
    {
        this.status = status;
    }

    public List< UserRoleRel > getRoles()
    {
        return roles;
    }

    public void setRoles( List< UserRoleRel > roles )
    {
        this.roles = roles;
    }
}
